#include <iostream>
#include <stdlib.h>
#include "TicketMachine.h"
#include "A.h"
#include "B.h"
#include "Child.h"

using namespace std;

void testTicketMachine();
void testInher();
void testConst();


int main() {
    
    testTicketMachine();
    testInher();
    testConst();

    return 0;
}

void testTicketMachine() {
    cout << "=======testTicketMachine=======" << endl;
    TicketMachine tm;
    tm.insertMoney(100);
    tm.showBalance();
}

void testInher() {
    cout << "=======testInher=======" << endl;
    A a(10);
    a.run();

    // B b;
    // b.run();
    
    // 继承
    Child c;
    c.set(1010);
    c.print();
}

void testConst()  {
    cout << "=======testConst=======" << endl;
    char *s = "Hello";
    char s1[] = "Hello";
    printf("s address=%p\n", s);
    printf("s1 address=%p\n", s1);
    printf("main address=%p\n", main);
    cout << s << endl;
    s[0] = 'h';
    cout << s << endl;
}
